package com.hue.springbootquartz;

import lombok.Data;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

@SpringBootApplication
public class SpringbootQuartzApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootQuartzApplication.class, args);
    }

    public static String fun(Class<?> aClass, String... strs) {
        Set<String> set = new HashSet<>();
        for (String str : strs) {
            set.add(str);
        }
        String sql = "";
        Field[] fields = aClass.getDeclaredFields();
        for (Field field : fields) {
            if (!set.contains(field.getName())) {
                sql += field.getName() + "=#{" + field.getName() + "},\n";
            }
        }
        return sql;
    }

    @Data
    private static class User {
        private String id;

        private String name;

        private Integer age;

        private String sex;
    }
}
